package cn.tedu.egmvc1.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
    @RequestMapping("/v1/users/insert")
    @ResponseBody
    public String insert(String username, String password, String nickname){
        return "添加用户成功: "+username+" "+ password+" "+ nickname;
    }

    @RequestMapping("/v1/users/userList")
    @ResponseBody
    public String userList(){
        return "查询用户列表成功";
    }

    @RequestMapping("/v1/users/delete")
    @ResponseBody
    public String delete(Integer id){
        return "删除成功，用户id为："+id;
    }

    @RequestMapping("/v1/users/update")
    @ResponseBody
    public String update(Integer id, String username, String password, String nickname){
        return "更新成功";
    }
}
